package game.Menus;

import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.geom.Vector2f;

import game.ActionListener;
import game.Config.Config;

/**
 * A picture item is an item containing a picture.
 * @author Sebastian Isheden and Victor Beer.
 *
 */
public class PictureMenuItem extends MenuItem{
	private Image image;

	/**
	 * Creates a new picture item
	 * @param image The image of the item.
	 * @param action The aciton of the item.
	 */
	public PictureMenuItem(Image image,ActionListener action) {
		super(action);
		this.image = image;
	}

	/**
	 * Prints the item to the screen.
	 */
	@Override
	public void print(Graphics graphic, Vector2f position, boolean selected) {
		if(selected){
			image.draw(position.x, position.y, Config.SELECTED_IMAGE_SCALE);
		}else{
			image.draw(position.x,position.y);
		}
	}
}
